home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / turble.arc / ASPECT.PAS next >
Pascal/Delphi Source File  |  1986-03-31  |  2KB  |  59 lines

  1. Program Aspect;
  2. Var
  3.   Width, Height, Aspect : Real; 
  4.   Ch : Char;
  5.   YMax : Integer;
  6.  
  7. {This program calculates the aspect and the maximum number of
  8. vertical pixels on your screen.  Notice that the program takes
  9. a couple extra pixels off the calculated maximum and rounds to
  10. an even number.  I found that the bottom few pixels didn't show
  11. up on my screen.  Your screen might show them. }
  12.  
  13. begin
  14.   GraphMode;                 
  15.   Draw(160,10,160,190,1);                {Draw test lines.                  }
  16.   Draw(70,100,250,100,1);
  17.   GotoXY(1,2);
  18.   Writeln('Measure the      ');
  19.   Writeln('horizontal line  ');
  20.   Writeln('with as much     ');
  21.   Writeln('precision as     ');
  22.   Writeln('you can.');
  23.   Writeln;
  24.   Writeln('Enter width      ');
  25.   Writeln('as a decimal     ');
  26.   Write('fraction: ');
  27.   Readln(width);
  28.   GotoXY(1,2);
  29.   Writeln('Measure the      ');
  30.   Writeln('vertical line    ');
  31.   Writeln('with as much     ');
  32.   Writeln('precision as     ');
  33.   Writeln('you can.');
  34.   Writeln;
  35.   Writeln('                 ');
  36.   Writeln('Enter height     ');
  37.   Writeln('as a decimal     ');
  38.   Write('fraction: ');
  39.   Readln(Height);
  40.   TextMode(BW80);
  41.   GotoXY(1,10);                          
  42.   Aspect := Width / Height;              {Calculate aspect.  Calculate...   } 
  43.   YMax := Trunc(200 / Aspect) - 2;       {...maximum Y and subtract 2 extra.}
  44.   If Odd(YMax) then YMax := YMax - 1;    {Round to even number.             }
  45.   Writeln('ScrunchUp = ',Aspect:3:2,';');
  46.   Writeln('HiYMax = ',2 * YMax);
  47.   Writeln;
  48.   Writeln('Write these numbers down or do a screen print. ');
  49.   Writeln('Then type them in as the constants in the first few');
  50.   Writeln('lines of the Turble Graphics include module.');
  51.   Writeln;
  52.   Writeln('Press any key to end. ');
  53.   Read(Kbd,Ch);
  54.   ClrScr;
  55. end.
  56.  
  57.  
  58.  
  59.